{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "\n",
    "cwd = os.environ.get('cwd'.upper(), '.')\n",
    "os.chdir(cwd)\n",
    "os.getcwd()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "factor = os.environ.get('factor'.upper(), 'SMA_010')\n",
    "fwd_ret_1 = os.environ.get('fwd_ret_1'.upper(), 'RETURN_OO_1')\n",
    "\n",
    "axvlines = ('2020-01-01', '2024-01-01',)\n",
    "\n",
    "factor, fwd_ret_1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import polars as pl\n",
    "\n",
    "from alphainspect.reports import create_3x2_sheet\n",
    "from alphainspect.utils import with_factor_quantile"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pl.read_parquet('data/data.parquet', columns=['date', 'asset', factor, fwd_ret_1])\n",
    "df = with_factor_quantile(df, factor, quantiles=10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "create_3x2_sheet(df, factor, fwd_ret_1, axvlines=axvlines);"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "py311_1",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
